// package demo.regexp;

import java.util.regex.*;

public class HelloRegExp {
    private static String CONTEXT = "{\"method\":\"SEEK\",\"data\":{\"token\":\"roomId+roomPw\",\"inner\":{\"ip\":\"22.33.22.33\",\"port\":1212}}}";
    private static String MATCH_PATTERN = "\"method\":\"(\\w+)\"";

    public static void main(String[] args) {

        boolean isMatch = Pattern.matches(MATCH_PATTERN, CONTEXT);
        System.out.println(isMatch);

        Pattern reg = Pattern.compile(MATCH_PATTERN);
        Matcher match = reg.matcher(CONTEXT);

        System.out.println(match.find());
        System.out.println(match.group(0));
        System.out.println(match.group(1));
    }
}